﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReallyReallyReallySimpleRoguelike.Managers;

namespace ReallyReallyReallySimpleRoguelike.Screens
{
    class ReplayScreen:Screen
    {

        public ReplayScreen()
        { 
            
        }

        public override void Show()
        {
            Console.Clear();
            
            Console.ForegroundColor = ConsoleColor.White;

            //prompt user
            Console.WriteLine("Replay? y or n");

            bool replay;
            ConsoleKey answer;

            //read keyboard
            answer = Console.ReadKey(true).Key;

            //is y pressed?
            replay = answer == ConsoleKey.Y;

            //if y is pressed start game
            if (replay)
            {
                GameManager.Instance.dungeonScreen.Show();
            }
            else if (answer != ConsoleKey.N)
            {
                //only n can quit, no accidental quit.
                Show();
            }
            else
            {
                //Do nothing and fall out of this to the next stage.  Should be the credits screen.
            }
            
            DungeonManager.Instance.PlaySound(SoundList.Pluck);
        }
    }
}
